using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._CartographyTools._GraphicConflicts
{
    /// <summary>
    /// <para>Detect Graphic Conflict</para>
    /// <para>Creates polygons where two or more symbolized features graphically conflict.</para>
    /// <para>创建两个或多个符号化要素在图形上冲突的面。</para>
    /// </summary>    
    [DisplayName("Detect Graphic Conflict")]
    public class DetectGraphicConflict : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public DetectGraphicConflict()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Layer</para>
        /// <para>The input feature layer containing symbolized features. CAD, coverage, or VPF annotation, and dimensions, charts, dot-density or proportional symbols, raster layers, network datasets, and 3D symbols are not acceptable inputs.</para>
        /// <para>包含符号化要素的输入要素图层。CAD、覆盖范围或 VPF 注记以及尺寸、图表、点密度或比例符号、栅格图层、网络数据集和 3D 符号是不可接受的输入。</para>
        /// </param>
        /// <param name="_conflict_features">
        /// <para>Conflict Layer</para>
        /// <para>The feature layer containing symbolized features potentially in conflict with symbolized features in the input layer.</para>
        /// <para>包含可能与输入图层中的符号化要素冲突的符号化要素的要素图层。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The output feature class to be created to store conflict polygons. It cannot be one of the feature classes associated with the input layers.</para>
        /// <para>要创建的用于存储冲突面的输出要素类。它不能是与输入图层关联的要素类之一。</para>
        /// </param>
        public DetectGraphicConflict(object _in_features, object _conflict_features, object _out_feature_class)
        {
            this._in_features = _in_features;
            this._conflict_features = _conflict_features;
            this._out_feature_class = _out_feature_class;
        }
        public override string ToolboxName => "Cartography Tools";

        public override string ToolName => "Detect Graphic Conflict";

        public override string CallName => "cartography.DetectGraphicConflict";

        public override List<string> AcceptEnvironments => ["cartographicCoordinateSystem", "cartographicPartitions", "referenceScale"];

        public override object[] ParameterInfo => [_in_features, _conflict_features, _out_feature_class, _conflict_distance, _line_connection_allowance];

        /// <summary>
        /// <para>Input Layer</para>
        /// <para>The input feature layer containing symbolized features. CAD, coverage, or VPF annotation, and dimensions, charts, dot-density or proportional symbols, raster layers, network datasets, and 3D symbols are not acceptable inputs.</para>
        /// <para>包含符号化要素的输入要素图层。CAD、覆盖范围或 VPF 注记以及尺寸、图表、点密度或比例符号、栅格图层、网络数据集和 3D 符号是不可接受的输入。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Conflict Layer</para>
        /// <para>The feature layer containing symbolized features potentially in conflict with symbolized features in the input layer.</para>
        /// <para>包含可能与输入图层中的符号化要素冲突的符号化要素的要素图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Conflict Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _conflict_features { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The output feature class to be created to store conflict polygons. It cannot be one of the feature classes associated with the input layers.</para>
        /// <para>要创建的用于存储冲突面的输出要素类。它不能是与输入图层关联的要素类之一。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Conflict Distance</para>
        /// <para>The area where input and conflict symbology is closer than a certain distance. Temporary buffers one-half the size of the conflict distance value are created around symbols in both the input and conflict layers. Conflict polygons will be generated where these buffers overlap. Conflict distance is measured in page units (points, inches, millimeters, or centimeters). If you enter a conflict distance in map units, it will be converted to page units using the reference scale. The default conflict distance is 0, where no buffers are created and only symbols that physically overlap one another are detected as conflicts.</para>
        /// <para>输入和冲突符号系统比特定距离更近的区域。临时缓冲区大小为冲突距离值的一半，在输入图层和冲突图层中的符号周围创建。将在这些缓冲区重叠的地方生成冲突多边形。冲突距离以页面单位（点、英寸、毫米或厘米）为单位。如果以地图单位输入冲突距离，则该距离将使用参考比例转换为页面单位。默认冲突距离为 0，其中不创建缓冲区，只有物理上相互重叠的符号才会被检测为冲突。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Conflict Distance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string _conflict_distance { get; set; } = "0 Points";


        /// <summary>
        /// <para>Line Connection Allowance</para>
        /// <para>The radius of a circle, centered where lines join, within which graphic overlaps won't be detected. This parameter is only considered when the input layer and the conflict layer are identical. Zero allowance will detect a conflict at each line join (if end caps are overlapping). Line connection allowance is calculated in page units (points, inches, millimeters, or centimeters). If you enter an allowance in map units, it will be converted to page units using the reference scale. The value cannot be negative; the default value is 1 point.</para>
        /// <para>圆的半径，以线连接处为中心，在该半径内不会检测到图形重叠。仅当输入层和冲突层相同时，才会考虑此参数。零余量将检测每个行连接处的冲突（如果端帽重叠）。行连接余量以页为单位（磅、英寸、毫米或厘米）计算。如果以地图单位输入限额，则该限额将使用参考比例转换为页面单位。该值不能为负数;默认值为 1 磅。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Line Connection Allowance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string _line_connection_allowance { get; set; } = "1 Points";


        public DetectGraphicConflict SetEnv(object cartographicCoordinateSystem = null, object cartographicPartitions = null, object referenceScale = null)
        {
            base.SetEnv(cartographicCoordinateSystem: cartographicCoordinateSystem, cartographicPartitions: cartographicPartitions, referenceScale: referenceScale);
            return this;
        }

    }

}